#pragma once

#include <QtWidgets/QMainWindow>

#include<qpushbutton.h>

#include <qlineedit.h>
#include  <qboxlayout.h>
#include <qlabel.h>

#include<qpropertyanimation.h>

#include <qsequentialanimationgroup.h>
#include "Scheduler.h"
#include "processWidget.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class QtPcb : public QWidget
{
    Q_OBJECT

public:
    QtPcb(QWidget *parent = nullptr);
    ~QtPcb();

private slots:

    void addProcessButton();
    void runButtonPrio();
    void runButtonR();
    void handleProcessStarted(int id);
    void handleProcessFinished(int id);
    void handleProcessUpdated(int id, int remainingTime);
private:
    QLineEdit* idInput;
    QLineEdit* timeInput;
    Scheduler scheduler;
    QVBoxLayout* processListLayout;
    QMap<int, ProcessWidget*> processWidgets;
    QSequentialAnimationGroup* animationGroup;
};
